package com.lottery.im.api;

import com.lottery.im.api.result.ApiListResult;
import com.lottery.im.api.result.ApiResult;
import com.lottery.im.api.result.entity.AdInfo;
import com.lottery.im.api.result.entity.AllGameInfo;
import com.lottery.im.api.result.entity.CanReceiveData0;
import com.lottery.im.api.result.entity.CanReceiveData1;
import com.lottery.im.api.result.entity.DoSign;
import com.lottery.im.api.result.entity.EmptyData;
import com.lottery.im.api.result.entity.FaceUrl;
import com.lottery.im.api.result.entity.FictitiousMap;
import com.lottery.im.api.result.entity.GameHistoryInfo;
import com.lottery.im.api.result.entity.GiveRedPackets;
import com.lottery.im.api.result.entity.GroupNotice;
import com.lottery.im.api.result.entity.GsUserInfo;
import com.lottery.im.api.result.entity.LoginEntity;
import com.lottery.im.api.result.entity.OtherUserInfo;
import com.lottery.im.api.result.entity.ReceivedRedPacketsReturnMap;
import com.lottery.im.api.result.entity.RedPacketsReturnMap;
import com.lottery.im.api.result.entity.ResultInfo;
import com.lottery.im.api.result.entity.SaleGameInfo;
import com.lottery.im.api.result.entity.ServiceData;
import com.lottery.im.api.result.entity.SignData;
import com.lottery.im.api.result.entity.SingleRedPacketsReceived;
import com.lottery.im.api.result.entity.UpdateInfo;
import com.lottery.im.api.result.entity.UserInfo;
import com.lottery.im.api.result.entity.UserOnlineState;
import com.lottery.im.api.result.entity.bank.BankList;
import com.lottery.im.api.result.entity.bank.UserBankList;
import com.lottery.im.api.result.entity.good.GoodList;
import com.lottery.im.api.result.entity.good.SetterByGameType;
import com.lottery.im.api.result.entity.integral.AccOutCondition;
import com.lottery.im.api.result.entity.integral.AccType;
import com.lottery.im.api.result.entity.integral.Commodity;
import com.lottery.im.api.result.entity.integral.CommodityDetail;
import com.lottery.im.api.result.entity.integral.ExchangeLog;
import com.lottery.im.api.result.entity.integral.ExchangeResult;
import com.lottery.im.api.result.entity.integral.UserCashList;
import com.lottery.im.api.result.entity.msg_bulletin.Bulletins;
import com.lottery.im.api.result.entity.msg_bulletin.BulletionDetails;
import com.lottery.im.api.result.entity.msg_bulletin.MessageCount;
import com.lottery.im.api.result.entity.msg_bulletin.MessageDetails;
import com.lottery.im.api.result.entity.msg_bulletin.Messages;
import com.lottery.im.api.result.entity.redpacket.CanReceiveData2;
import com.lottery.im.api.result.entity.redpacket.Type3SQ;
import io.reactivex.Observable;
import java.util.List;
import java.util.Map;
import okhttp3.MultipartBody;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

/**
 * Created by lianwufeng on 2017/7/21.
 */

public interface ApiService {

  // 登录
  @FormUrlEncoded
  @POST(value = "login.do")
  Observable<ApiResult<LoginEntity>> login(@Field("userId") String userId,
      @Field("password") String password, @Field("browerType") String browerType);

  // 验证码登录
  @FormUrlEncoded
  @POST(value = "quickLogin.do")
  Observable<ApiResult<LoginEntity>> fastLogin(@Field("userId") String userId,
      @Field("phone") String phone, @Field("attach") String attach);

  // 发送短信验证码
  @FormUrlEncoded
  @POST(value = "sendSMVerificationCode.do")
  Observable<ApiResult<EmptyData>> sendSMVerificationCode(@Field("mobile") String mobile);

  // 注册
  @FormUrlEncoded
  @POST(value = "userReg.do")
  Observable<ApiResult<LoginEntity>> userReg(@Field("userId") String userId,
      @Field("phone") String phone, @Field("password") String password,
      @Field("userName") String userName, @Field("u") String u,
      @Field("attach") String attach);

  // 忘记密码
  @FormUrlEncoded
  @POST(value = "updateUserPassword.do")
  Observable<ApiResult<EmptyData>> resetPassword(@Field("userId") String userId,
      @Field("phone") String phone, @Field("attach") String attach,
      @Field("password") String password, @Field("confirmPassword") String confirmPassword);

  //服务列表信息
  @POST(value = "queryInformationListFront.do")
  Observable<ApiListResult<ServiceData.ReturnListBean>> getServiceData();

  // Banner、活动 等
  @POST(value = "indexBannerAndRollAdPage.do")
  Observable<ApiResult<AdInfo>> getAD();

  //用户签到信息
  @FormUrlEncoded
  @POST(value = "queryUserSignListByUserId.do")
  Observable<ApiResult<SignData>> getSignData(@Field("userId") String userId,
      @Field("token") String token, @Field("signDateByMonth") String signDateByMonth);

  //校验是否有签到积分可以领取
  @FormUrlEncoded
  @POST(value = "isCanReceive.do")
  Observable<ApiResult<CanReceiveData0.ReturnMapBean>> isCanReceive0(@Field("userId") String userId,
      @Field("token") String token, @Field("type") String type);

  @FormUrlEncoded
  @POST(value = "isCanReceive.do")
  Observable<ApiResult<CanReceiveData1.ReturnMapBean>> isCanReceive1(@Field("userId") String userId,
      @Field("token") String token, @Field("type") String type);

  //用户领取签到奖励
  @FormUrlEncoded
  @POST(value = "receiveSignReword.do")
  Observable<ApiResult<CanReceiveData0.ReturnMapBean>> ReceiveSignReword0(
      @Field("userId") String userId,
      @Field("token") String token, @Field("type") String type);

  @FormUrlEncoded
  @POST(value = "receiveSignReword.do")
  Observable<ApiResult<CanReceiveData1.ReturnMapBean>> ReceiveSignReword1(
      @Field("userId") String userId,
      @Field("token") String token, @Field("type") String type);

  //用户签到操作
  @FormUrlEncoded
  @POST(value = "userSign.do")
  Observable<ApiResult<DoSign>> userSign(@Field("userId") String userId,
      @Field("token") String token);

  // 查询所有彩种开奖结果-预测
  @POST(value = "queryAllGameTypeResult.do")
  Observable<ApiListResult<ResultInfo>> queryAllGameTypeResult();

  // 查询所有彩种长龙统计-预测
  @POST(value = "queryAllStatis.do")
  Observable<ApiListResult<List<String>>> queryAllStatistics();

  // 查询所有彩种-预测
  @POST(value = "queryGameTypeByGameTypeMode.do")
  Observable<ApiListResult<AllGameInfo>> queryAllGame();

  // 查询单个彩种开奖结果-预测
  @FormUrlEncoded
  @POST(value = "queryGameTypeResultByGameType.do")
  Observable<ApiListResult<GameHistoryInfo>> queryGameTypeResult(@Field("gameType") String gameType,
      @Field("startRow") int startRow, @Field("pageSize") int pageSize);

  // 查询双面统计type=1、长龙统计type=2-预测
  @FormUrlEncoded
  @POST(value = "queryDXDSLost.do")
  Observable<ApiListResult<String>> queryDXDSLost(@Field("gameType") String gameType,
      @Field("type") String type);

  //查询基本的用户内容
  @FormUrlEncoded
  @POST(value = "queryUserCommonInfo.do")
  Observable<ApiResult<UserInfo>> queryUserCommonInfo(@Field("userId") String userId,
      @Field("token") String token);

  //获取系统消息条数
  @FormUrlEncoded
  @POST(value = "queryUserSystemMessageCount.do")
  Observable<ApiResult<MessageCount>> queryUserSystemMessageCount(@Field("userId") String userId,
      @Field("token") String token);

  //分页查询用户系统消息列表
  @FormUrlEncoded
  @POST(value = "querySystemMessageList.do")
  Observable<ApiListResult<Messages>> querySystemMessageList(@Field("userId") String userId,
      @Field("token") String token, @Field("startRow") String startRow,
      @Field("pageSize") String pageSize);

  //查询用户系统消息详情
  @FormUrlEncoded
  @POST(value = "querySystemMessageDetails.do")
  Observable<ApiResult<MessageDetails>> querySystemMessageDetails(@Field("userId") String userId,
      @Field("token") String token, @Field("id") long id);

  //查询公告列表
  @FormUrlEncoded
  @POST(value = "getBulletin.do")
  Observable<ApiListResult<Bulletins>> getBulletin(@Field("userId") String userId,
      @Field("token") String token, @Field("startRow") String startRow,
      @Field("pageSize") String pageSize);

  //根据bulletinId查询公告详情
  @FormUrlEncoded
  @POST(value = "queryBulletinByBulletinId.do")
  Observable<ApiResult<BulletionDetails>> queryBulletinByBulletinId(@Field("userId") String userId,
      @Field("token") String token, @Field("bulletinId") int id);

  //商品列表
  @FormUrlEncoded
  @POST(value = "commodityGetLimit.do")
  Observable<ApiListResult<Commodity>> queryCommodityList(@Field("startRow") String startRow);

  //商品详情
  @FormUrlEncoded
  @POST(value = "commodityGetById.do")
  Observable<ApiResult<CommodityDetail>> queryCommodityDetail(@Field("id") int id);

  //IM用户上传群头像
  @Multipart
  @POST(value = "updateGroupFaceUrl.do")
  Observable<ApiResult<FaceUrl>> updateGroupFaceUrl(@Part List<MultipartBody.Part> partList);

  //群公告列表
  @FormUrlEncoded
  @POST(value = "groupNoticeGetAll.do")
  Observable<ApiListResult<GroupNotice>> groupNoticeGetAll(@Field("userId") String userId,
      @Field("token") String token, @Field("groupId") String groupId);

  //群公告新增/编辑
  @FormUrlEncoded
  @POST(value = "groupNoticeAdd.do")
  Observable<ApiResult<Object>> groupNoticeAdd(@Field("userId") String userId,
      @Field("token") String token,
      @Field("groupId") String groupId, @Field("content") String content, @Field("id") String id);

  //群在线人数
  @FormUrlEncoded
  @POST(value = "imGetGroupUserOnline.do")
  Observable<ApiListResult<UserOnlineState>> imGetGroupUserOnline(@Field("ids") String ids);

  //群成员VIP情况
  @FormUrlEncoded
  @POST(value = "getUserByThirdIds.do")
  Observable<ApiListResult<Map<String, OtherUserInfo>>> getUserByThirdIds(@Field("ids") String ids);

  //商品购买
  @FormUrlEncoded
  @POST(value = "exchangeBuy.do")
  Observable<ApiResult<ExchangeResult>> exchangeBuy(@Field("userId") String userId,
      @Field("token") String token, @Field("num") int num, @Field("commodityId") int commodityId);

  //商品兑换记录
  @FormUrlEncoded
  @POST(value = "exchangeLogGetLimit.do")
  Observable<ApiListResult<ExchangeLog>> exchangeLogGetLimit(@Field("userId") String userId,
      @Field("token") String token, @Field("startRow") int startRow,
      @Field("pageSize") int pageSize);

  //获取用户的资金流水(积分明细)
  @FormUrlEncoded
  @POST(value = "queryUserCashList.do")
  Observable<ApiListResult<UserCashList>> queryUserCashList(@Field("userId") String userId,
      @Field("token") String token, @Field("startRow") int startRow,
      @Field("pageSize") int pageSize);

  @FormUrlEncoded
  @POST(value = "queryUserCashList.do")
  Observable<ApiListResult<UserCashList>> queryUserCashListFilter(@Field("userId") String userId,
      @Field("token") String token, @Field("startDate") String startDate,
      @Field("endDate") String endDate, @Field("accType") String accType,
      @Field("startRow") int startRow, @Field("pageSize") int pageSize);

  //整点红包随机生成领取记录
  @FormUrlEncoded
  @POST(value = "getType3SQList.do")
  Observable<ApiResult<Type3SQ>> getType3SQList(@Field("userId") String userId,
      @Field("token") String token);

  @FormUrlEncoded
  @POST(value = "isCanReceive.do")
  Observable<ApiResult<CanReceiveData2>> loadCanReceive2(@Field("userId") String userId,
      @Field("token") String token, @Field("type") String type);

  //用户领取单聊红包
  @FormUrlEncoded
  @POST(value = "receiveSingleRedPackets.do")
  Observable<ApiResult<SingleRedPacketsReceived>> receiveSingleRedPackets(
      @Field("userId") String userId,
      @Field("token") String token, @Field("redPacketsId") String redPacketsId);

  //查看单个红包详情
  @FormUrlEncoded
  @POST(value = "querySingleRedPacketsDetail.do")
  Observable<ApiResult<ReceivedRedPacketsReturnMap>> querySingleRedPacketsDetail(
      @Field("userId") String userId,
      @Field("token") String token, @Field("redPacketsId") String redPacketsId);

  //红包记录
  @FormUrlEncoded
  @POST(value = "queryRedPacketsRecord.do")
  Observable<ApiResult<RedPacketsReturnMap>> queryRedPacketsRecord(
      @Field("userId") String userId,
      @Field("token") String token, @Field("redPacketsFlag") int redPacketsFlag,
      @Field("startRow") int startRow, @Field("pageSize") int pageSize);

  //查询银行列表
  @POST(value = "queryBankList.do")
  Observable<ApiListResult<BankList>> queryBankList();

  //获取用户银行卡列表信息
  @FormUrlEncoded
  @POST(value = "queryUserBankList.do")
  Observable<ApiListResult<UserBankList>> queryUserBankList(
      @Field("userId") String userId, @Field("token") String token);

  //绑定银行卡操作
  @FormUrlEncoded
  @POST(value = "userBindCard.do")
  Observable<ApiResult<EmptyData>> userBindCard(
      @Field("userId") String userId, @Field("token") String token,
      @Field("bankType") String bankType, @Field("bankAccount") String bankAccount,
      @Field("bankAccountName") String bankAccountName);

  //用户的提现操作
  @FormUrlEncoded
  @POST(value = "userAccOut.do")
  Observable<ApiResult<EmptyData>> userAccOut(
      @Field("userId") String userId, @Field("token") String token,
      @Field("outPassword") String outPassword, @Field("bankId") String bankId,
      @Field("outAmount") String outAmount, @Field("phone") String phone);

  //用户领取群聊红包
  @FormUrlEncoded
  @POST(value = "receiveRedPackets.do")
  Observable<ApiResult<SingleRedPacketsReceived>> receiveRedPackets(
      @Field("userId") String userId,
      @Field("token") String token, @Field("redPacketsId") String redPacketsId);

  //查看群红包详情
  @FormUrlEncoded
  @POST(value = "queryRedPacketsDetail.do")
  Observable<ApiResult<ReceivedRedPacketsReturnMap>> queryRedPacketsDetail(
      @Field("userId") String userId,
      @Field("token") String token, @Field("redPacketsId") String redPacketsId);

  //设置提现密码（即资金密码）
  @FormUrlEncoded
  @POST(value = "updateWithdrawPassword.do")
  Observable<ApiResult<Object>> updateWithdrawPassword(
      @Field("userId") String userId,
      @Field("token") String token, @Field("newAccountPassword") String newAccountPassword);

  //发送单个红包
  @FormUrlEncoded
  @POST(value = "giveSingleRedPackets.do")
  Observable<ApiResult<GiveRedPackets>> giveSingleRedPackets(
      @Field("userId") String userId,
      @Field("token") String token, @Field("receivedUserId") String receivedUserId,
      @Field("money") String money, @Field("note") String note, @Field("payPwd") String payPwd);

  //发送群里红包
  @FormUrlEncoded
  @POST(value = "giveRedPackets.do")
  Observable<ApiResult<GiveRedPackets>> giveRedPackets(
      @Field("userId") String userId, @Field("token") String token,
      @Field("groupId") String groupId, @Field("redPacketsType") int redPacketsType,
      @Field("totalMoney") String totalMoney, @Field("singleMoney") String singleMoney,
      @Field("totalNumber") String totalNumber, @Field("note") String note,
      @Field("payPwd") String payPwd);

  //IM用户上传用户头像
  @Multipart
  @POST(value = "uploadUserHeadImg.do")
  Observable<ApiResult<FaceUrl>> uploadUserHeadImg(@Part List<MultipartBody.Part> partList);

  //修改个人资料
  @FormUrlEncoded
  @POST(value = "updateUserInfoForFront.do")
  Observable<ApiResult<UserInfo>> updateUserInfoForFront(@FieldMap Map<String, String> map);

  //修改登录密码
  @FormUrlEncoded
  @POST(value = "updatePassword.do")
  Observable<ApiResult<Object>> updatePassword(@Field("userId") String userId,
      @Field("token") String token, @Field("oldPassword") String oldPassword,
      @Field("newPassword") String newPassword);

  //修改资金密码
  @FormUrlEncoded
  @POST(value = "updateAccountPassword.do")
  Observable<ApiResult<Object>> updateAccountPassword(@Field("userId") String userId,
      @Field("token") String token, @Field("oldAccountPassword") String oldAccountPassword,
      @Field("newAccountPassword") String newAccountPassword);

  //重置资金密码
  @FormUrlEncoded
  @POST(value = "checkPayPwd.do")
  Observable<ApiResult<Object>> checkPayPwd(@Field("userId") String userId,
      @Field("token") String token, @Field("mobile") String mobile, @Field("code") String code,
      @Field("payPwd") String payPwd);

  //设置验证密码
  @FormUrlEncoded
  @POST(value = "setEquipmentPwd.do")
  Observable<ApiResult<Object>> setEquipmentPwd(@Field("userId") String userId,
      @Field("token") String token, @Field("pwdInfo") String pwdInfo);

  //校验验证密码
  @FormUrlEncoded
  @POST(value = "checkEquipmentPwd.do")
  Observable<ApiResult<Object>> checkEquipmentPwd(@Field("userId") String userId,
      @Field("token") String token, @Field("pwdInfo") String pwdInfo);

  //高手计划
  @FormUrlEncoded
  @POST(value = "fictitiousSetterByGameType.do")
  Observable<ApiResult<SetterByGameType>> querySetterByGameType(
      @Field("gameType") String gameType, @Field("userId") String userId,
      @Field("token") String token);

  @FormUrlEncoded
  @POST(value = "getList.do")
  Observable<ApiListResult<GoodList>> queryGoodList(
      @Field("setterId") int setterId, @Field("userId") String userId,
      @Field("token") String token);

  //积分明细筛选
  @FormUrlEncoded
  @POST(value = "queryAccTypeNameList.do")
  Observable<ApiListResult<AccType>> queryAccTypeNameList(@Field("userId") String userId,
      @Field("token") String token);

  //获取高手计划用户信息
  @FormUrlEncoded
  @POST(value = "getById.do")
  Observable<ApiResult<GsUserInfo>> getById(@Field("id") int id,
      @Field("userId") String userId,
      @Field("token") String token);

  //高手计划最近两期开奖情况
  @FormUrlEncoded
  @POST(value = "querySaleGameInfo.do")
  Observable<ApiResult<SaleGameInfo>> querySaleGameInfo(
      @Field("gameType") String gameType);

  //高手计划预测记录
  @FormUrlEncoded
  @POST(value = "getFictitiousRecord.do")
  Observable<ApiResult<FictitiousMap>> getFictitiousRecord(
      @Field("id") int id, @Field("limit") int limit,
      @Field("userId") String userId,
      @Field("token") String token);

  //高手计划 点赞
  @FormUrlEncoded
  @POST(value = "good.do")
  Observable<ApiResult<EmptyData>> good(@Field("id") int id,
      @Field("userId") String userId,
      @Field("token") String token);

  //查询APP升级信息
  @FormUrlEncoded
  @POST(value = "queryAppUpdateInfo.do")
  Observable<ApiResult<UpdateInfo>> queryAppUpdateInfo(@Field("appType") String appType);

  //删除群公告
  @FormUrlEncoded
  @POST(value = "deleteGroupNotice.do")
  Observable<ApiResult<EmptyData>> deleteGroupNotice(@Field("userId") String userId,
      @Field("token") String token,@Field("id") String id);

  //现金兑换信息
  @FormUrlEncoded
  @POST(value = "queryAccOutCondition.do")
  Observable<ApiResult<AccOutCondition>> queryAccOutCondition(@Field("userId") String userId,
      @Field("token") String token);
}
